home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / apps / cmapDoctor / cmapdoctor / DrawwinDerived.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.8 KB  |  80 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /////////////////////////////////////////////////////////////
  18. //
  19. // Source file for DrawwinDerived
  20. //
  21. //    This file generated by BuilderXcessory. 
  22. /////////////////////////////////////////////////////////////
  23.  
  24. #include "DrawwinDerived.h"
  25. #include <iostream.h>
  26.  
  27. extern "C" {
  28. void displayColormap(Display *);
  29. };
  30.  
  31. DrawwinDerived::DrawwinDerived(const char *name, Widget parent) : 
  32.                    Drawwin(name, parent) 
  33.     exposed = False;
  34. }
  35.  
  36.  
  37. DrawwinDerived::~DrawwinDerived()
  38. {
  39.   // Empty
  40. }
  41.  
  42.  
  43. const char * DrawwinDerived::className() // classname
  44. {
  45.     return ("DrawwinDerived");
  46. }
  47.  
  48. void DrawwinDerived::drawInput(Widget w, XtPointer callData) 
  49. {    
  50.     XmDrawingAreaCallbackStruct *cbs = (XmDrawingAreaCallbackStruct *)callData;
  51.     XEvent *event = cbs->event;
  52.     
  53.     if (event->xany.type == ButtonPress) {
  54.         selectx = event->xbutton.x;
  55.         selecty = event->xbutton.y;
  56.         displayColormap(XtDisplay(w));
  57.     }
  58. }
  59.  
  60.  
  61. void DrawwinDerived::setExposed(Widget w, XtPointer) 
  62. {    
  63.   static int first = 1;
  64.   
  65.     if (first) {
  66.         first = 0;
  67.         exposed = True;
  68.     }
  69.     else {
  70.         displayColormap(XtDisplay(w));
  71.     }
  72. }
  73.  
  74.  
  75. Boolean DrawwinDerived::isExposed()
  76. {
  77.     return(exposed);
  78. }
  79.